#FROM openjdk:8-jre-slim
FROM --platform=linux/amd64 tomcat:8.5.95-jdk8-corretto-al2
# 环境变量
ENV WORK_PATH /usr/local/tomcat/webapps
ENV APP_NAME ROOT.war
ENV APP_VERSION @project.version@


RUN rm -rf /usr/local/tomcat/webapps/*
RUN sed -i 's/8080/16002/' /usr/local/tomcat/conf/server.xml

EXPOSE 11501

#USER
#USER user:group

#VOLUME
VOLUME ["/home/project", "/tmp/data"]

#ADD

#COPY
ADD $APP_NAME $WORK_PATH/
RUN chmod 777 /usr/local/tomcat/bin/catalina.sh

#LABEL
#STOPSIGNAL
#ARG
#ONBUILD

# WORKDIR
WORKDIR $WORK_PATH
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

ENTRYPOINT ["/usr/local/tomcat/bin/catalina.sh","run"]
